/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 29489
 * Date: 2023-03-16
 * Time: 9:13
 */
import com.sun.nio.sctp.PeerAddressChangeNotification;

import java.util.Scanner;
public class Main {
//    public static void main(String[] args) {
//        Scanner sc = new Scanner(System.in);
//        Student stu = new Student(sc.next(), sc.nextInt(), sc.next());
//        System.out.println(stu.toString());
//    }
//    public static void main(String[] args) {
//        Scanner sc = new Scanner(System.in);
//
//        Vehicle v1 = new Vehicle();
//        Vehicle v2 = new Vehicle();
//
//        v1.setKind(sc.next());
//        v1.setSpeed(sc.nextDouble());
//        v1.setColor(sc.next());
//
//        v2.setKind(sc.next());
//        v2.setSpeed(sc.nextDouble());
//        v2.setColor(sc.next());
//
//        System.out.println("第一辆是"+v1.getKind()+"，时速为"+v1.getSpeed()+"km/h，颜色为"+v1.getColor());
//        System.out.println("第二辆是"+v2.getKind()+"，时速为"+v2.getSpeed()+"km/h，颜色为"+v2.getColor());
//    }
//    public static void main(String[] args) {
//        Scanner sc = new Scanner(System.in);
//
//        Rectangle rec1 = new Rectangle(sc.nextDouble(), sc.nextDouble());
//        Rectangle rec2 = new Rectangle(sc.nextDouble(), sc.nextDouble());
//
//        rec1.print();
//        rec2.print();
//    }
//    public static void main(String[] args) {
//        Scanner sc = new Scanner(System.in);
//        int n = sc.nextInt();
//
//        Person[] person = new Person[n];
//        for(int i = 0; i < n; ++i){
//            Person tmp = new Person(sc.next(), sc.nextInt(), sc.nextBoolean());
//            person[i] = tmp;
//        }
//        for(int i = n-1; i >= 0; --i){
//            person[i].print();
//        }
//        new Person().print();
//    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Person2[] person = new Person2[n];

        for(int i = 0; i < n; ++i){
            Person2 tmp = new Person2(sc.next(), sc.nextInt());
            person[i] = tmp;

            System.out.println(person[i].toString());
        }
        String name = sc.next();
        boolean is = false;
        for(int i = 0; i < n; ++i)
        {
            if(person[i].getName().equals(name) == true)
            //if(name == person[i].getName())
            {
                is = true;
                System.out.println("查询结果：");
                System.out.println(person[i].toString());
                break;
            }
        }
        if(!is){
            System.out.println("not found");
        }
    }
}
